<?php
$this->title = '个人信息';
?>
<body class="m-my-set u-bg1">

<dl class="f-cb"><dt>昵称</dt><dd id="J_editName"><?= empty($data['user']['nickname']) ?  '点击输入昵称' : $data['user']['nickname']?></dd></dl>
<dl class="f-cb"><dt>头像</dt><dd id="J_editAvatar"><img class="avatar" src="/static/img/avatar.jpg"></dd></dl>
<dl class="f-cb"><dt>手机号码</dt><dd id="J_editPhone"><?= $data['user']['mobile']?></dd></dl>
<dl class="f-cb"><dt>邮箱</dt><dd id="J_editMail"><?= empty($data['user']['email']) ?  '点击输入邮箱' : $data['user']['email']?></dd></dl>
<dl class="f-cb"><dt>收货地址</dt><dd id="J_editAddress"><?= empty($data['address']['detail']) ?  '您还没有添加收货地址' : $data['address']['detail']?></dd></dl>

<h4><a href="/web/my">返回</a></h4>

<script>
    $(function(){
        $('#J_editAddress').click(function(){
            window.location.href = '/web/address';
        });
        $('#J_editName').click(function(){
            window.location.href = '/web/user/update?nickname=<?= $data['user']['nickname']?>';
        });
        $('#J_editPhone').click(function(){
            window.location.href = '/web/user/update?mobile=<?= $data['user']['mobile']?>';
        });
        $('#J_editMail').click(function(){
            window.location.href = '/web/user/update?email=<?= $data['user']['email']?>';
        });
    });

</script>
</body>